package org.ogv.tween;

import java.util.HashMap;

import org.ogv.tween.ease.*;

public class EaseFactory {
	private HashMap<Integer, EaseFunc> _lib;
	private static EaseFactory _inst;
	private EaseFactory() {
		_lib = new HashMap<Integer, EaseFunc>();
		_lib.put(LINEAR, new EaseLinear());
		_lib.put(INOUT_CUBIC, new EaseInOutCubic());
		_lib.put(INOUT_QUINTIC, new EaseInOutQuintic());
		_lib.put(OUT_ELASTIC, new EaseOutElastic());
		_lib.put(OUT_QUAD, new EaseOutQuad());
		_lib.put(IN_QUAD, new EaseInQuad());
	}
	
	public static EaseFactory inst() {
		if(_inst == null) _inst = new EaseFactory();
		return _inst;
	}
	
	public EaseFunc getEase(int id) {
		return _lib.get(id);
	}
	
	//CONSTANTS
	public static final int NONE 			= 0;
	public static final int LINEAR 			= 1;
	public static final int INOUT_CUBIC 	= 2;
	public static final int INOUT_QUINTIC 	= 3;
	public static final int OUT_ELASTIC 	= 4;
	public static final int OUT_QUAD 		= 5;
	public static final int IN_QUAD 		= 6;
}
